<?php
    $block_title =     $this->vote_info->thread_name.($this->vote_info->phase_name!=""?" - ".$this->vote_info->phase_name:"");
?>
<!--Left Bar:-->
        <!--right Bar:-->
        <div id="leftbar">
            <!--Slide:-->
            <div id="slide" class="event-area-l">
                <div class="event-area-bounder">
                    <div class="event-header-short-l">
                        <span class="value">Slide</span>
                    </div>
                    <div class="event-content-short">
                        <div style="text-align:center">
                            <script type="text/javascript">
                                new fadeshow(fadeimages, 270, 360, 0, 3000, 0, "R")
                            </script>
                            </div>
                            <p style="margin-top:10px;">
                                Hãy bình chọn cho các thí sinh mình yêu thích nhất!
                                Để đánh giá và bình chọn cho các thí sinh trên <a href="http://www.tamtay.vn" target="_blank">www.tamtay.vn</a> bạn cần phải <a href="<?php echo IDS_REGISTER_URL;?>" target="_blank">đăng ký</a> tài khoản.                                    
                            </p>
                        </div>
                    </div>
            </div>
            <!--Het slide-->
            
<div class="advertisment">
                <a href="#" title="Bình chọn: <?=$block_title?>" target="_blank"><img src="<?php print $this->spath; ?>/images/b_c.gif" /></a>
            </div>
            
            <!--Top 10 thi sinh:-->
                <?php echo $this->top_block?>
            <!--Het top 10-->
            
            <div class="advertisment"></div>
            
            <!--Gop y :-->
            <div id="wall" class="event-area-l">
            <div class="event-area-bounder">
                <div class="event-header-short-l">
                    <span class="value">Ý kiến khán giả</span>
                </div>
                    
                <div class="event-content-short" id="wall_block">
                    <?php echo $this->comment_block?>
                </div>  
            </div>                          
        </div>
            <!--Het gop y-->
                
                
            <div class="advertisment"><a href="http://video.tamtay.vn" target="_blank"><img src="<?php print $this->spath; ?>/images/phim.gif" /></a></div>
            <div class="advertisment"><a href="http://photo.tamtay.vn" target="_blank"><img src="<?php print $this->spath; ?>/images/dang_anh.gif" /></a></div>
            <div class="advertisment"><a href="http://music2.tamtay.vn" target="_blank"><img src="<?php print $this->spath; ?>/images/nhac.gif" /></a></div>
            
      </div>
        
        <div id="wrapper">
            <div id="content">
            
                <!--Info:-->
                <div id="info" class="event-area">
                    <div class="event-header-long">
                        <span class="value">Bình chọn: <?=$block_title?></span>                    
                    </div>
                    <div class="event-content-long">
                        <div class="photo_poll">
                            <!--Can chuyen cac class sau vao file .css (chinh duong dan anh cho dung)-->
                            <style>
                                .photo_menu li {
                                    list-style-type:none;
                                    display:inline;
                                    margin-right:20px;
                                }
                                .photo_menu ul {
                                    font-weight:bold;
                                    list-style-type:none;
                                }
                                .huongdanbinhchon {
                                    display:none; 
                                    border-bottom:1px solid #f5f5f5;
                                    border-top:1px solid #e9f4f8;
                                    padding:10px;
                                    background:url(<?php print $this->spath; ?>/images/binhchon_huongdan_bg.gif) top repeat-x;
                                }
                                .member_list {
                                    margin:0px;
                                    margin-bottom:15px;
                                    padding:0px 0px;
                                }
                                .member_list .item_member { 
                                    margin:0px;
                                    padding:0px;
                                    list-style-type:none;
                                    padding:5px 0px 5px 0px;
                                    background-color:#fff;
                                }  
                                .member_list .item_member:hover { 
                                    background-color:#f6faff;
                                }                   
                                .member_list .header {                        
                                    list-style-type:none; 
                                    font-weight:bold;
                                    background:url(<?php print $this->spath; ?>/images/binhchon_title_bg.gif) repeat-x bottom;
                                    padding:5px 0px;
                                    margin-bottom:10px;
                                }
                                
                                .float-left { float:left}
                                .member_list .image { width:160px; padding-left:5px;}
                                .member_list .order { 
                                    position:absolute; 
                                    margin:4px 0px 0px 4px; 
                                    padding:2px; 
                                    background-color:#fff; 
                                    font-family:Georgia, "Times New Roman", Times, serif;
                                    filter: alpha(opacity=70);
                                    opacity:0.7;
                                    }
                                .member_list .image img { width:150px; height:auto; border:1px solid #e5e5e5; padding:1px;}
                                .member_list .name { width:180px;}
                                .member_list .name a{ font-weight:bold;}
                                .member_list .view { width:60px; text-align:center}
                                .member_list .sms { width:70px; text-align:center}
                                .member_list .web { width:70px; text-align:center}
                                .member_list .total { width:70px; text-align:center}
                                .member_list .soantin { color:#999999; margin-top:10px;}
                                .member_list .soantin .maso { color:#3366CC; font-weight:bold;}
                                .member_list .soantin .gui { color:#009900; font-weight:bold;}
                             </style>
                            <ul class="member_list">
                                <!--Tieu de:-->
                                <li class="header">
                                    <div class="float-left image">&nbsp;Hình ảnh</div>
                                    <div class="float-left name">Thông tin</div>
                                    <div class="float-left view">Xem</div>
                                    <div class="float-left sms">SMS</div>
                                    <div class="float-left web">Web</div>
                                    <div class="float-left total">Tổng</div>
                                    <div class="clear"></div>
                                </li>
                                <?php
                                if(is_array($this->voted_list) && count($this->voted_list)>0){
                                $i = 1;
                                foreach($this->voted_list as $node){
                        
                                    $img="http://img.tamtay.vn" . $node->thumbnail;
                                    $star = 0;
                                    if(isset($node->rate_value))
                                        $star=ceil($node->rate_value/20);
                                    
                                    //$web_vote=round($o->rate_value*$o->vote_web_count, 0);
                                    $web_vote = $node->vote_web_count;
                                    if ($this->total_vote_web==0){
                                        $web_percent=0;
                                    }
                                    else{
                                        $web_percent=round($web_vote/$this->total_vote_web, 4)*100;
                                    }
                                    if ($this->total_vote_sms==0){
                                        $sms_percent=0;
                                    }
                                    else{
                                        $sms_percent=round($node->vote_sms_count/$this->total_vote_sms, 4)*100;
                                    }
                                    $t=$web_percent + $sms_percent;
                                ?>
                                <!--Danh sach thi sinh:-->
                                <li class="item_member">
                                    <div class="float-left image">
                                        <!--<span class="order">1</span>-->
                                        <a href="http://photo.tamtay.vn/photo/view/<?php echo $node->aid;?>" title="<?php echo $node->album_name;?>"><img src="<?php print $this->spath; ?>/images/spacer.gif" style="background-image: url('<?php echo $static_server.$node->thumbnail;?>'); background-position: center; background-repeat: no-repeat;" /></a>
                                    </div>
                                    <div class="float-left name">
                                        <p><a href="http://photo.tamtay.vn/photo/view/<?php echo $node->aid;?>" target="_blank"><?php echo $node->album_name;?></a></p>
                                        <p><img src="http://img.tamtay.vn/images/stars<?php echo $star; ?>.gif" /></p>
                                        <p class="soantin">Soạn : <span class="maso"><?php echo $this->vote_info->sms_command_code;?>&nbsp;<?php echo $node->sbd; ?></span> gửi <span class="gui"><?php echo $this->vote_info->sms_destination1;?></span> (<em><span style="color:red;"><?php echo $this->vote_info->sms_basic_num1;?></span> phiếu</em>)
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hoặc gửi <span class="gui"><?php echo $this->vote_info->sms_destination2;?></span> (<em><span style="color:red;"><?php echo $this->vote_info->sms_basic_num2;?></span> phiếu</em>).
                                        </p>
                                    </div>                        
                                    <div class="float-left view">
                                        <?php echo $node->view_count; ?>
                                    </div>
                                    <div class="float-left sms">
                                        <?php echo $sms_percent;?>%
                                    </div>
                                    <div class="float-left web">
                                        <?php echo $web_percent;?>%
                                    </div>
                                    <div class="float-left total">
                                        <?php echo $t;?>%
                                    </div>
                                    <div class="clear"></div>
                                </li>
                              <?php
                                    }// End for loop
                                }// End if
                            ?>
                            </ul>
                        </div>                            
                    </div>
                </div>
                <!--End info-->

          </div>
        </div>       
        
        